<?php

/**
 * @name: stack.class.php
 * @version: 1.0
 * @package: PHP MVC Framework
 * @uses: Sorts out stack includes
 * @copyright: MIT
 * @author Andrew Lowther
 */

// Set up the stack include path
define('stack', dirname(dirname(__FILE__)) . '/ray/');

class Stack {

    public function __construct($class) {
		
    	$dir = strtolower($class);

		// Set up the include path
		$paths = array(stack, stack . 'helpers/', stack . '../plugins/' . $dir . '/lib/', stack . 'auth/', stack . 'core/', stack .'db/', stack . 'exception/', stack . 'form/', stack . 'helper/', stack . 'session/', stack . 'validate/');
		
		// Set the include path
		set_include_path(implode(PATH_SEPARATOR, $paths));

        // Set up the class file
        $file = strtolower($class) . '.class.php';

        // Check the file exists
        if (!include $file) {

            return false;

        }

    }

}

?>
